Ext.define('carManage.view.repairInfo.GridList', {
    extend: 'Ext.grid.Panel',
    store: 'RepairInfoStore',
    alias: 'widget.gridList',
    selModel: Ext.create('Ext.selection.CheckboxModel', {mode: "SIMPLE"}),
    initComponent: function() {
        this.columns = [
            {
                header: '编号',
                sortable: true,
                hidden: true,
                dataIndex: 'id'
            }, {
                header: '车牌号码',
                sortable: true,
                width: 85,
                dataIndex: 'car_code'
            }, {
                header: '维修类型',
                sortable: true,
                width: 78,
                dataIndex: 'type',
                renderer: function(v) {
                    if (v == '1') {
                        return '自备修理'
                    } else if (v == '2') {
                        return '外协修理'
                    } else if (v == '3') {
                        return '应急修理'
                    }
                }
            }, {
                header: '维修时间',
                sortable: true,
                width: 92,
                dataIndex: 'repair_date'
            }, {
                header: '维修站',
                sortable: true,
                width: 117,
                dataIndex: 'area'
            }, {
                header: '维修金额',
                sortable: true,
                width: 70,
                dataIndex: 'repair_price'
            }, {
                header: '驾驶员',
                sortable: true,
                width: 70,
                dataIndex: 'driver'
            }, {
                header: '里程表清零',
                sortable: true,
                width: 75,
                dataIndex: 'clean',
                renderer: function(v) {
                    if (v == 'yes') {
                        return '是'
                    } else {
                        return '否'
                    }
                }
            }, {
                header: '批准日期',
                sortable: true,
                width: 84,
                dataIndex: 'approve_date'
            }, {
                header: '批准人',
                sortable: true,
                width: 64,
                dataIndex: 'approve_person'
            }, {
                header: '维修前里程',
                sortable: true,
                width: 80,
                dataIndex: 'mileage'
            }, {
                header: '维修内容',
                sortable: true,
                width: 300,
                dataIndex: 'repair_content'
            }, {
                header: '备注',
                sortable: true,
                width: 300,
                dataIndex: 'remark'
            }
        ];

        this.bbar = new Ext.PagingToolbar({
            store: 'RepairInfoStore',
            emptyMsg: '没有数据需要显示',
            displayInfo: true
        });
        this.callParent(arguments);
    }
});